#!/usr/bin/env python  
#coding=utf-8  
  
import os  
  
def scan_files(directory,prefix=None,postfix=None):  
    files_list=[]  
      
    for root, sub_dirs, files in os.walk(directory):  
        for special_file in files:  
            if postfix:  
                if special_file.endswith(postfix):  
                    files_list.append(os.path.join(root,special_file))  
            elif prefix:  
                if special_file.startswith(prefix):  
                    files_list.append(os.path.join(root,special_file))  
            else:  
                files_list.append(os.path.join(root,special_file))  
                            
    return files_list  


if __name__ == "__main__":
	rootdir = "/home/data/zhliu_doc/git/project"
	files_list = scan_files(rootdir)
	#print(files_list);
	for files in files_list: 
		print(files[len(rootdir):-1])
	
